import React from 'react';
import { Redirect } from "react-router-dom";

import LWTDiscover from "@/pages/discover";
import LWTPlayer from "@/pages/player";
import LWTMine from "@/pages/mine";
import LWTFriend from "@/pages/friend";
import LWTRecommend from "@/pages/discover/c-pages/recommend";
import LWTRanking from "@/pages/discover/c-pages/ranking";
import LWTSongs from "@/pages/discover/c-pages/songs";
import LWTDjradio from "@/pages/discover/c-pages/djradio";
import LWTArtist from "@/pages/discover/c-pages/artist";
import LWTAlbum from "@/pages/discover/c-pages/album";

const routes = [
  {
    path: "/",
    exact: true,
    render: () => (
      <Redirect to="/discover"/>
    )
  },
  {
    path: "/discover",
    component: LWTDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to="/discover/recommend"/>
        )
      },
      {
        path: "/discover/recommend",
        component: LWTRecommend
      },
      {
        path: "/discover/ranking",
        component: LWTRanking
      },
      {
        path: "/discover/songs",
        component: LWTSongs
      },
      {
        path: "/discover/djradio",
        exact: true,
        component: LWTDjradio
      },
      {
        path: "/discover/artist",
        component: LWTArtist
      },
      {
        path: "/discover/album",
        component: LWTAlbum
      },
      {
        path: "/discover/player",
        component: LWTPlayer
      }
    ]
  },
  {
    path: "/mine",
    component: LWTMine
  },
  {
    path: "/friend",
    component: LWTFriend
  },
];

export default routes;